/**
 * 编辑器类型定义
 */

// 位置类型
export interface Position {
  x: number;
  y: number;
}

// 比例类型
export interface Scale {
  x: number;
  y: number;
}

// 图层类型
export interface Layer {
  id: string;
  name: string;
  visible: boolean;
  locked: boolean;
  type: string;
  position: Position;
  scale: Scale;
  rotation: number;
  opacity: number;
  assetId?: string;
  [key: string]: any;
}

// 关键帧类型
export interface Keyframe {
  id: string;
  time: number;
  value: any;
}

// 轨道类型
export interface Track {
  id: string;
  name: string;
  type: string;
  layerId: string;
  visible: boolean;
  locked: boolean;
  keyframes: Keyframe[];
}

// 素材类型
export interface Asset {
  id: string;
  name: string;
  type: string;
  thumbnail: string;
  url?: string;
  metadata?: any;
}

// 项目类型
export interface Project {
  id: string;
  name: string;
  createdAt: Date;
  updatedAt: Date;
  duration: number;
  layers: Layer[];
  tracks: Track[];
  assets: Asset[];
}

// 拖动状态类型
export interface DragState {
  isDragging: boolean;
  type: string;
  startX: number;
  startY: number;
  targetId: string;
  originalValue: any;
}

// 编辑器状态类型
export interface EditorState {
  currentTime: number;
  isPlaying: boolean;
  selectedLayerId: string | null;
  selectedTrackId: string | null;
  selectedKeyframeId: string | null;
  zoom: number;
  dragState: DragState;
}

// 时间线缩放选项
export const ZOOM_OPTIONS = [
  { label: '25%', value: 2.5 },
  { label: '50%', value: 5 },
  { label: '100%', value: 10 },
  { label: '200%', value: 20 },
  { label: '400%', value: 40 }
];

// 图层类型常量
export const LAYER_TYPES = {
  IMAGE: 'image',
  CHARACTER: 'character',
  SCENE: 'scene',
  TEXT: 'text',
  AUDIO: 'audio',
  GROUP: 'group'
};

// 轨道类型常量
export const TRACK_TYPES = {
  TRANSFORM: 'transform',
  OPACITY: 'opacity',
  ROTATION: 'rotation',
  AUDIO: 'audio',
  EFFECT: 'effect'
}; 